<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>

    let obj = {
      a:10,
      b:20
    }
    let proxy = new Proxy(obj,{
      get(target,key){
        console.log("我触发了")
        console.log(target,key);
        return target[key];
      },
      set(target,key,v){
        target[key] = v;
      }
    });
    // console.log(obj.a)
    console.log(proxy.a);
    proxy.a = 200;
    console.log(proxy.a)
  </script>
</body>
</html>